import com.sun.scenario.effect.impl.sw.sse.SSEBlend_SRC_OUTPeer;

import  java.util.Scanner;
import  java.util.Random;
public class Test {
    public static void main(String[] args) {
        //逻辑控制课件代码练习
/**
 int num=10;
 if(num%2==0){
 System.out.println("num是偶数");
 }else{
 System.out.println("num是奇数");


 int num=-190;
 if(num>0){
 System.out.println("num是正数");
 }else if(num<0){
 System.out.println("num是负数");
 }else{
 System.out.println("num是0");
 }

 int year=2000;
 if(year%100==0){
 if(year%400==0){
 System.out.println("是世纪闰年");
 }else{
 System.out.println("不是世纪闰年");
 }
 }else{
 if(year%4==0){
 System.out.println("是闰年");
 }else{
 System.out.println("不是闰年");
 }
 }

 int x=10;
 int y=20;
 if(x==10)
 if(y==20)
 System.out.println("hehe");
 else
 System.out.println("haha");//悬垂else

 int x=10;
 if(x==20);{
 System.out.println("aaa");//封号问题
 }

 int day=6;
 switch(day) {//switch中的值只能是整数、字符、字符串
 case 1:
 System.out.println("星期一");
 break;
 case 2:
 System.out.println("星期二");
 break;
 case 3:
 System.out.println("星期三");
 break;

 default:
 System.out.println("周末");
 break;
 }

 int num=1;
 while(num<=100){
 System.out.printf("%d ",num);
 num++;
 }

 int num=1;
 int result=0;
 while(num<=100){
 result+=num;
 num++;
 }
 System.out.println(result);

 int  num=1;
 int result=1;
 while(num<=5){
 result*=num;
 num++;
 }
 System.out.println(result);

 int num=1;
 int sum=0;
 //外层循环负责求各阶乘的和；
 while(num<=5){
 int factorResult=1;
 int tmp=1;
 //里层循环负责完成求阶乘的细节；
 while(tmp<=num){
 factorResult*=tmp;
 tmp++;
 }
 sum+=factorResult;
 num++;
 }
 System.out.println(sum);

 int num=100;
 while(num<=200){
 if(num%3==0){
 System.out.println("找到了3的倍数，为："+num);
 break;
 }
 num++;
 }

 int num=100;
 while(num<=200){
 if(num%3!=0){
 num++;
 continue;
 }
 System.out.println("找到了3的倍数，为："+num);
 num++;
 }

 int num=1;
 do{
 System.out.println(num);
 num++;
 }while(num<=10);

 Scanner sc=new Scanner(System.in);
 System.out.println("请输入你的姓名：");
 String name=sc.nextLine();
 System.out.println("请输入你的年龄：");
 int age=sc.nextInt();
 System.out.println("请输入你的工资");
 double salary=sc.nextDouble();
 System.out.println("你的信息如下：");
 System.out.println("姓名："+name+"\n"+"年龄："+age+"\n"+"工资："+salary);
 sc.close();//注意要记得调用关闭方法；

 int count =1;
 while(count<=3){
 int psd=123456;
 Scanner sc=new Scanner(System.in);
 System.out.println("请输入密码：");
 int psd1=sc.nextInt();
 if(psd==psd1){
 System.out.println("输入正确");
 }else if(psd1!=psd){
 System.out.println("请重新输入");
 count++;
 }
 }
 System.out.println("输入错误，系统已被锁定，请联系工作人员");

 Random random=new Random();
 Scanner sc=new Scanner(System.in);
 int toGuess=random.nextInt(100);
 while(true){
 System.out.println("请输入想输入的数字：（1-100）");
 int num=sc.nextInt();
 if(num<toGuess){
 System.out.println("小了");
 }else if(num>toGuess){
 System.out.println("大了");
 }else{
 System.out.println("猜对了");
 break;
 }
 }
 sc.close();

 */
    }
     }

